import request from "@/request";

const api_name = '/admin/system/sysDept'
/*
 * 机构管理模块
 */
export default {
// 查询机构树
    listTree(page, limit, searchObj) {
        return request({
            url: `${api_name}/findNodes`,
            method: "get",
            params: searchObj
        });
    },

    listPage(page, limit, searchObj) {
        return request({
            url: `${api_name}/findNodes`,
            method: 'get',
            params: searchObj // url查询字符串或表单键值对
        })
    },

    getAllSysDept(searchObj) {
        return request({
            url: `${api_name}/findNodes`,
            method: "get",
            params: searchObj
        });
    },

    getDeptById(id) {
        return request({
            url: `${api_name}/get/${id}`,
            method: "get",
        });
    },

// 新增
    save(data) {
        return request({
            url: `${api_name}/save`,
            method: "post",
            data,
        });
    },
// 编辑
    update(data) {
        return request({
            url: `${api_name}/update`,
            method: "put",
            data,
        });
    },

// 删除
    remove(data) {
        return request({
            url: `${api_name}/batchRemove`,
            method: "delete",
            data,
        });
    }
}
